<?php
class Form_News extends Zend_Form
{
    public function __construct($options=array())
    {
		parent::__construct($options);
    	//$this->setAction("/admin/news/doadd/");
		$this->setName("newsform");
		$this->setAttrib('id', 'newsform');
		$this->setMethod('post');
		if($options["action"]=="add" || $options["action"]=="doadd")
        {
             $this->setAction('/admin/news/doadd/');
        }
        else{
            $this->setAction('/admin/news/doedit/');
        }
		
        // Add heading element
		$this->addPrefixPath('AML_Form_Element', '../library/Form/Element/', 'element');
		
		$news_title = new Zend_Form_Element_Text('news_subtitle');
        $news_title ->setLabel('Heading * :')
          ->setRequired(true)
          ->setAllowEmpty(false)
          ->setOptions(array('class'=>'inputbox'));
        $this->addElement($news_title);

		
		$news_desc = $this ->addElement('formRTE', 'news_sub_desc',
			array('label' =>'Description:',
				'validators' =>array(
				array('validator' =>'StringLength', 'options' =>array(0, 1000))
			),			
		));
		
		$news_type = new Zend_Form_Element_Select('type');
		$news_type->class = "select_tab";
	    $news_type ->setLabel('Type')
	    		   ->setRequired(true)
	    		   ->addMultiOptions(array(
						'' => 'Select Type',
				    	'news1' => 'News1',
						'news2' => 'News2'));
					
					
							
		$this->addElement($news_type);
		
		$news_status = new Zend_Form_Element_Select('status');
		$news_status->class = "select_tab";
	    $news_status ->setLabel('Status')
	    			->setRequired(true)
	    			 ->addMultiOptions(array(
						'' => 'Select Status',
				    	1 => 'Active',
						0 => 'De-Active'));
					
							
		$this->addElement($news_status);
		
		$this->addElement('hidden', 'news_id', array(
        	'filters'	=> array('int'),
        	'class'		=> 'hidden',
        ));
    }   
}
